//
//  MusicNetTool.m
//  MVVM
//
//  Created by 宜必鑫科技 on 2017/10/19.
//  Copyright © 2017年 宜必鑫科技. All rights reserved.
//

#import "MusicNetTool.h"

@implementation MusicNetTool

+ (void)getMusicDataWithPageId:(NSInteger)pageId completionHandle:(void(^)(id model, NSError *error))complete
{
    NSMutableDictionary *dic = [NSMutableDictionary dictionary];
    if(![PublicModel isBlankString:[PublicModel getUserid]] && ![PublicModel isBlankString:[PublicModel getToken]])
    {
        dic[@"userid"] = [PublicModel getUserid];
        dic[@"token"] = [PublicModel getToken];
    }
    dic[@"now_page"] = @(pageId);
    dic[@"page_size"] = @(20);
    dic[@"type_code"] = @"T0201";
    NSString *body = [NSString stringWithFormat:@"action=%@",dic];
    
    [WJNetTool POST:[PublicModel getFetalRecordListURL] body:body bodyStyle:WJBodyString header:nil response:WJJSON success:^(id resuposeObject) {
        complete(resuposeObject, nil);
    } failure:^(NSError *error) {
        complete(nil, error);
    }];
    
}
@end
